import request from '@/utils/request'

export default {
    //获取菜单列表
    menuList(keywords) {
        return request({
            url: `/admin/menus`,
            method: 'get',
            params:{keywords}
        })
    },
    //添加或修改菜单
    saveOrUpdateMenu(menu) {
        return request({
            url: `/admin/menus`,
            method: 'post',
            data: menu
        })
    }
    ,
    //删除菜单
    deleteMenu(id) {
        return request({
            url: `/admin/menus/${id}`,
            method: 'delete',
        })
    },
    //隐藏菜单
    hiddenMenu(menu) {
        return request({
            url: `/admin/menus`,
            method: 'put',
            data:menu
        })
    },
    //用户菜单
    userMenuList() {
        return request({
            url: `admin/users/menus`,
            method: 'get',
        })
    }
}